import com.huxiao.pojo.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest1 {
    public static void main(String[] args) {

    }
    @Test
//    p命名空间应用
    public void test2(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("userbean.xml");
        User user = applicationContext.getBean("user", User.class);
        System.out.println(user);

    }

    @Test
    public void test3(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("userbean.xml");
        User user = applicationContext.getBean("user2", User.class);
        System.out.println(user);

    }

    @Test
    public void test4(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("userbean.xml");
        User user = applicationContext.getBean("user", User.class);
        User user2 = applicationContext.getBean("user2", User.class);

        System.out.println(user.hashCode());
        System.out.println(user2.hashCode());
        System.out.println(user == user2);

    }




}
